/* GUI CONVERTED from mrmprp01.p (converter v1.75) Sun Aug 13 17:21:42 2000 */
/* mrmprp01.p - MRP DETAIL REPORT USER INTERFACE / REPORT DRIVER        */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert mrmprp01.p (converter v1.00) Fri Oct 10 13:57:13 1997 */
/* web tag in mrmprp01.p (converter v1.00) Mon Oct 06 14:17:36 1997 */
/*F0PN*/ /*K103*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 1.0    LAST MODIFIED: 07/18/86     BY: EMB                 */
/* REVISION: 1.0    LAST MODIFIED: 12/29/86     BY: EMB *36*            */
/* REVISION: 4.0    LAST MODIFIED: 01/07/88     BY: EMB *A133*          */
/* REVISION: 2.0    LAST MODIFIED: 01/22/88     BY: PML *A158*          */
/* REVISION: 4.0    LAST MODIFIED: 03/18/88     BY: EMB *A162*          */
/* REVISION: 4.0    LAST MODIFIED: 02/16/88     BY: FLM *A175*          */
/* REVISION: 4.0    LAST MODIFIED: 05/17/88     BY: EMB                 */
/* REVISION: 5.0    LAST MODIFIED: 11/08/89     BY: EMB *B386*          */
/* REVISION: 5.0    LAST MODIFIED: 10/19/90     BY: emb *B806*          */
/* REVISION: 6.0    LAST MODIFIED: 05/17/90     BY: RAM *D026*          */
/* REVISION: 6.0    LAST MODIFIED: 08/09/90     BY: emb *D040*          */
/* REVISION: 6.0    LAST MODIFIED: 10/29/90     BY: WUG *D151*          */
/* REVISION: 6.0    LAST MODIFIED: 11/15/90     BY: emb *D219*          */
/* REVISION: 6.0    LAST MODIFIED: 08/02/91     BY: bjb *D811*          */
/* REVISION: 6.0    LAST MODIFIED: 07/28/92     BY: emb *F816*          */
/* REVISION: 7.3    LAST MODIFIED: 08/19/93     BY: emb *GE37*          */
/* REVISION: 7.3    LAST MODIFIED: 12/01/93     BY: emb *F024*          */
/* REVISION: 7.2    LAST MODIFIED: 04/14/94     BY: WUG *FN37*          */
/* REVISION: 7.2    LAST MODIFIED: 09/01/94     BY: ljm *FQ67*          */
/* REVISION: 7.3    LAST MODIFIED: 10/18/94     BY: jzs *GN61*          */
/* REVISION: 7.5    LAST MODIFIED: 03/02/95     BY: tjs *J014*          */
/* REVISION: 8.6    LAST MODIFIED: 10/15/97     BY: ckm *K103*          */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E   LAST MODIFIED: 04/13/98     BY: *J2JD* Sachin Shah  */
/* REVISION: 8.6E   LAST MODIFIED: 10/12/98     BY: *L0BY* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/13/00 BY: *N0KR* myb              */
/*J2JD* GROUPED MULTIPLE FIELD ASSIGNMENTS INTO ONE AND ADDED NO-UNDO
        WHEREVER MISSING FOR PERFORMANCE AND SMALLER R-CODE */

/*J014*/ /* Program re-written */

     {mfdtitle.i "b+ "}


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE mrmprp01_p_1 "Sort by Item Number or BOM/Formula"
/* MaxLen: Comment: */

&SCOPED-DEFINE mrmprp01_p_2 "Include Base Process Orders"
/* MaxLen: Comment: */

&SCOPED-DEFINE mrmprp01_p_3 "Item Number/BOM Formula"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

     define new shared variable part        like pt_part NO-UNDO.
     define new shared variable part1       like pt_part NO-UNDO.
     define new shared variable bom         like wo_bom_code NO-UNDO.
     define new shared variable bom1        like wo_bom_code NO-UNDO.
     define new shared variable site        like si_site NO-UNDO.
     define new shared variable site1       like si_site NO-UNDO.
     define new shared variable buyer       like pt_buyer NO-UNDO.
     define new shared variable prod_line   like pt_prod_line NO-UNDO.
     define new shared variable ptgroup     like pt_group NO-UNDO.
     define new shared variable part_type   like pt_part_type NO-UNDO.
     define new shared variable vendor      like pt_vend NO-UNDO.
     define new shared variable pm_code     like pt_pm_code NO-UNDO.
     define new shared variable show_base   like mfc_logical initial true
        label {&mrmprp01_p_2} NO-UNDO.
     define new shared variable item_sort   like mfc_logical initial true
        format {&mrmprp01_p_3}
        label {&mrmprp01_p_1} NO-UNDO.
     define new shared variable frwrd       like soc_fcst_fwd.
     define new shared variable bck         like soc_fcst_bck.

     
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
       
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
part            colon 22
       part1           label {t001.i} colon 49
       bom             colon 22
       bom1            label {t001.i} colon 49
       site            colon 22
       site1           label {t001.i} colon 49
       buyer           colon 22
       prod_line       colon 22
       ptgroup         colon 22
       part_type       colon 22
       vendor          colon 22
       pm_code         colon 22
       show_base       colon 40
       item_sort       colon 40
      SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



     /* SET EXTERNAL LABELS */
     setFrameLabels(frame a:handle).

     assign
     site = global_site
     site1 = global_site.

/*K103*/ {wbrp01.i}
        
/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

/*GN61      do on error undo, retry: */

           if part1 = hi_char then assign part1 = "".
           if site1 = hi_char then assign site1 = "".
           if bom1 = hi_char then assign bom1 = "".

/*K103*/ if c-application-mode <> 'web' then
              
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K103*/ {wbrp06.i &command = update &fields = "  part part1 bom bom1 site site1
buyer prod_line ptgroup part_type vendor pm_code show_base item_sort" &frm = "a"}

/*K103*/ if (c-application-mode <> 'web') or
/*K103*/ (c-application-mode = 'web' and
/*K103*/ (c-web-request begins 'data')) then do:

           assign bcdparm = "".
           {mfquoter.i part      }
           {mfquoter.i part1     }
           {mfquoter.i bom       }
           {mfquoter.i bom1      }
           {mfquoter.i site      }
           {mfquoter.i site1     }
           {mfquoter.i buyer     }
           {mfquoter.i prod_line }
           {mfquoter.i ptgroup   }
           {mfquoter.i part_type }
           {mfquoter.i vendor    }
           {mfquoter.i pm_code   }
           {mfquoter.i show_base }
           {mfquoter.i item_sort }

           if part1 = "" then assign part1 = hi_char.
           if bom1 = "" then assign bom1 = hi_char.
           if site1 = "" then assign site1 = hi_char.
           hide message.

/*K103*/ end.

              
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



           {mfphead.i}

           /* Sales Forecast consumption parameters */
/*J2JD**   find first soc_ctrl no-lock no-error. **/
/*J2JD*/   for first soc_ctrl fields (soc_fcst_fwd soc_fcst_bck)
/*J2JD*/   no-lock : end.
           if available soc_ctrl then do:
           assign
          frwrd = soc_fcst_fwd
          bck = soc_fcst_bck.
           end.

           if item_sort then do:
          {gprun.i ""mrmprp1f.p""}
           end.
           else do: /* BOM SORT */
          {gprun.i ""mrmprp1g.p""}
           end.

           
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

/*GN61      end. */
     end.

     assign global_site = site.

/*K103*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" part part1 bom bom1 site site1 buyer prod_line ptgroup part_type vendor pm_code show_base item_sort "} /*Drive the Report*/
